/**
 * @Date: 2022-04-07 19:10:18
 * @LastEditors: sailornpg
 * @LastEditTime: 2022-07-15 20:52:36
 * @FilePath: \weibo-api\middleware\loginCheck.js
 * @Description: 单独登陆验证
 */
const { SuccessModel, ErrorModel } = require("../ResModel/index");
const auth = async (ctx, next) => {
  if (ctx.session && ctx.session.userInfo) {
    await next();
    return;
  }
  ctx.body = new ErrorModel(401, "请登陆");
};
module.exports = {
  auth,
};
